import Home from '../pages/Home'
import Login from '../pages/Login'
import User from '../pages/User'
import NotFound from '../pages/NotFound'
import About from '../pages/about/About'
import Contact from '../pages/about/Contact'
import { lazy } from 'react'
// 路由规则数组

const routes = [
    {
        path: '/',
        // element: <Home />,
        Component: lazy(() => import('../pages/Home')),
        meta: {
            title: '首页',
            isLogin: false
        },
        children: [
            {
                path: '/about',
                element: <About />,
                meta: {
                    title: '关于我们',
                    isLogin: false
                },
            },
            {
                path: '/contact',
                element: <Contact />,
                meta: {
                    title: '联系我们',
                    isLogin: false
                },
            }
        ]
    },
    {
        path: '/login',
        element: <Login />,
        meta: {
            title: '登录',
            isLogin: false
        }
    },
    {
        path: '/user',
        element: <User />,
        meta: {
            title: '会员中心',
            isLogin: true
        },
    },
    // 404路由
    {
        path: "*",
        element: <NotFound />,
        meta: {
            title: '404',
            isLogin: false
        },
    }
]

export default routes